package com.bjpowernode.compare;

import com.bjpowernode.beans.Stu;
import com.bjpowernode.tools.MyTools;

import java.util.Comparator;

/**
 * ClassName:StuNameCompare
 * Package:com.bjpowernode.compare
 * Description: 描述信息
 *
 * @date:2022/4/22 10:39
 * @author:动力节点
 */
public class StuAgeCompare implements Comparator<Stu> {
    @Override
    public int compare(Stu o1, Stu o2) {
        if (MyTools.getTime(o1.getAge()) > MyTools.getTime(o2.getAge())) {
            return 1;
        } else if (MyTools.getTime(o1.getAge()) < MyTools.getTime(o2.getAge())) {
            return -1;
        } else {
            return 0;
        }
    }
}
